package com.easy.yours.biz.model;

import com.easy.system.model.BaseBean;
import org.hibernate.annotations.ForeignKey;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: sunguangzhu
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "t_clazz", catalog = "commonproject")
public class Clazz extends BaseBean implements java.io.Serializable {

    /**
     * 名称
     */
    private java.lang.String name;

    /**
     * 学生集合
     */
    private java.util.Set<com.easy.yours.biz.model.Student> students;

    /**
     * default constructor
     */
    public Clazz() {
    }

    /**
     * full constructor
     *
     * @param name
     * @param students
     */
    public Clazz(java.lang.String name, java.util.Set<com.easy.yours.biz.model.Student> students) {
        this.name = name;
        this.students = students;
    }

    /**
     * getter
     */
    @Column
    public java.lang.String getName() {
        return this.name;
    }

    /**
     * setter
     *
     * @param name
     */
    public void setName(java.lang.String name) {
        this.name = name;
    }

    /**
     * getter
     */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clazz")
    public java.util.Set<com.easy.yours.biz.model.Student> getStudents() {
        return this.students;
    }

    /**
     * setter
     *
     * @param students
     */
    public void setStudents(java.util.Set<com.easy.yours.biz.model.Student> students) {
        this.students = students;
    }

}
